How would i down-sample a .wav file then reconstruct it using nyquist? - in matlab [closed]

Posted by martin on Stack Overflow See other posts from Stack Overflow or by martin
Published on 2010-12-28T00:13:59Z Indexed on 2010/12/28 14:53 UTC
Read the original article Hit count: 657

Filed under:

Possible Duplicate:
How would i down-sample a .wav file then reconstruct it using nyquist? - in matlab

This is all done in MatLab 2010

My objective is to show the results of: undersampling, nyquist rate/ oversampling

First i need to downsample the .wav file to get an incomplete/ or impartial data stream that i can then reconstuct.

Heres the flow chart of what im going to be doing So the flow is analog signal -> sampling analog filter -> ADC -> resample down -> resample up -> DAC -> reconstruction analog filter

what needs to be achieved:

F= Frequency

F(Hz=1/s) E.x. 100Hz = 1000 (Cyc/sec) F(s)= 1/(2f)

Example problem: 1000 hz = Highest frequency 1/2(1000hz) = 1/2000 = 5x10(-3) sec/cyc or a sampling rate of 5ms

This is my first signal processing project using matlab.

what i have so far.

% Fs = frequency sampled (44100hz or the sampling frequency of a cd)

[test,fs]=wavread('test.wav'); % loads the .wav file
left=test(:,1);

% Plot of the .wav signal time vs. strength

time=(1/44100)*length(left);
t=linspace(0,time,length(left));
plot(t,left)
xlabel('time (sec)');
ylabel('relative signal strength')

**%this is were i would need to sample it at the different frequecys (both above and below and at) nyquist frequency.*I think.***

soundsc(left,fs) % shows the resaultant audio file , which is the same as original ( only at or above nyquist frequency however) 

Can anyone tell me how to make it better, and how to do the various sampling at different frequencies?

© Stack Overflow or respective owner

How would i down-sample a .wav file then reconstruct it using nyquist? - in matlab [closed]

Posted by martin on Programmers See other posts from Programmers or by martin
Published on 2010-12-28T00:13:59Z Indexed on 2010/12/28 1:01 UTC
Read the original article Hit count: 657

This is all done in MatLab 2010

My objective is to show the results of: undersampling, nyquist rate/ oversampling

First i need to downsample the .wav file to get an incomplete/ or impartial data stream that i can then reconstuct.

Heres the flow chart of what im going to be doing So the flow is analog signal -> sampling analog filter -> ADC -> resample down -> resample up -> DAC -> reconstruction analog filter

what needs to be achieved:

F= Frequency

F(Hz=1/s) E.x. 100Hz = 1000 (Cyc/sec) F(s)= 1/(2f)

Example problem: 1000 hz = Highest frequency 1/2(1000hz) = 1/2000 = 5x10(-3) sec/cyc or a sampling rate of 5ms

This is my first signal processing project using matlab.

what i have so far.

% Fs = frequency sampled (44100hz or the sampling frequency of a cd)

[test,fs]=wavread('test.wav'); % loads the .wav file
left=test(:,1);

% Plot of the .wav signal time vs. strength

time=(1/44100)*length(left);
t=linspace(0,time,length(left));
plot(t,left)
xlabel('time (sec)');
ylabel('relative signal strength')

**%this is were i would need to sample it at the different frequecys (both above and below and at) nyquist frequency.*I think.***

soundsc(left,fs) % shows the resaultant audio file , which is the same as original ( only at or above nyquist frequency however) 

Can anyone tell me how to make it better, and how to do the various sampling at different frequencies?

© Programmers or respective owner

Related posts about matlab